﻿// App Module: the name AngularStore matches the ng-app attribute
// in the main <html> tag. The route provides parses the URL and
// injects the appropriate partial page
var storeApp = angular.module('AngularStore', []).
  config(['$routeProvider', function ($routeProvider) {
      $routeProvider.
    when('/store', {
        templateUrl: 'partials/store.htm',
        controller: storeController
    })
      when('/products/:productSku', {
          templateUrl: 'partials/product.htm',
          controller: storeController
      })
      when('/cart', {
          templateUrl: 'partials/shoppingCart.htm',
          controller: storeController
      })
      otherwise({
          redirectTo: '/store'
      });
  } ]);